﻿<UserControl x:Class="Bewise.Phone.MessageBar"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="480" d:DesignWidth="480">

    <Grid Name="messageBox" Height="Auto" Opacity="0" Visibility="Collapsed" Margin="10" MinHeight="60" MouseLeftButtonUp="messageBox_MouseLeftButtonUp">
        <Grid.Resources>
            <Storyboard x:Key="moveUp">
                <DoubleAnimation Duration="0:0:0.1" To="1.0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="messageBox"/>
                <DoubleAnimation Duration="0:0:0.1" To="0" Storyboard.TargetProperty="Y" Storyboard.TargetName="boxTranslate"/>
            </Storyboard>
            <Storyboard x:Key="moveDown">
                <DoubleAnimation Duration="0:0:0.2" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="messageBox"/>
                <DoubleAnimation Duration="0:0:0.2" To="60" Storyboard.TargetProperty="Y" Storyboard.TargetName="boxTranslate"/>
            </Storyboard>
        </Grid.Resources>
        <Grid.RenderTransform>
            <TranslateTransform x:Name="boxTranslate" Y="60"/>
        </Grid.RenderTransform>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Border BorderThickness="1" BorderBrush="{StaticResource PhoneBorderBrush}" Background="{StaticResource PhoneChromeBrush}" HorizontalAlignment="Stretch">
            <Grid Margin="5">
                <TextBlock TextWrapping="Wrap" x:Name="messageTextError" FontSize="{StaticResource PhoneFontSizeMedium}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Red"/>
                <TextBlock TextWrapping="Wrap" x:Name="messageText" Visibility="Collapsed" FontSize="{StaticResource PhoneFontSizeNormal}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{StaticResource PhoneForegroundBrush}"/>
            </Grid>
        </Border>
    </Grid>
</UserControl>
